package com.oig.sys.file.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Schema
@Data
public class BusFileConfigDto {

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups= GroupEdit.class)
    private Integer id;

//    @Schema(description = "应用id")
//    @NotNull(message = "参数错误,应用id不能为空", groups= {GroupAdd.class, GroupEdit.class})
//    private Integer systemId;
//    @Schema(description = "应用名称")
//    private String systemName;

    @Schema(description = "主业务类型,对应枚举 BusinessType 01-代理 02-仓储 03-运输", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,业务类型不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private String businessType;

    @Schema(description = "具体子单据类型,对应枚举 RelationType")
    private String relationType;

    @Schema(description = "存储桶", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,存储桶不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private String bucketName;


    @Schema(description = "文件大小限制,不填不限制")
    private String fileSize;

    @Schema(description = "文件类型限制,多种类型逗号“,”分隔,不填不限制")
    private String fileTypes;

    @Schema(description = "创建人id")
    private Integer createId;
    @Schema(description = "创建人")
    private String createName;
    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @Schema(description = "最后更新人id")
    private Integer lastUpdateId;
    @Schema(description = "最后更新人")
    private String lastUpdateName;
    @Schema(description = "最后更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastUpdateTime;

    @Schema(description = "复核人id")
    private Integer checkId;
    @Schema(description = "复核人")
    private String checkName;
    @Schema(description = "复核时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date checkTime;
    @Schema(description = "复核备注")
    private String checkRemark;

    @Schema(description = "0-保存，1-提交审核 默认保存")
    private String reqType;
}
